\(\int \cos (a+b x) \csc (2 a+2 b x) \, dx\) [136]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F(-1)]
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 16, antiderivative size = 14 \[ \int \cos (a+b x) \csc (2 a+2 b x) \, dx=-\frac {\text {arctanh}(\cos (a+b x))}{2 b} \]

[Out]

-1/2*arctanh(cos(b*x+a))/b

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {4372, 3855} \[ \int \cos (a+b x) \csc (2 a+2 b x) \, dx=-\frac {\text {arctanh}(\cos (a+b x))}{2 b} \]

[In]

Int[Cos[a + b*x]*Csc[2*a + 2*b*x],x]

[Out]

-1/2*ArcTanh[Cos[a + b*x]]/b

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4372

Int[(cos[(a_.) + (b_.)*(x_)]*(e_.))^(m_.)*sin[(c_.) + (d_.)*(x_)]^(p_.), x_Symbol] :> Dist[2^p/e^p, Int[(e*Cos
[a + b*x])^(m + p)*Sin[a + b*x]^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && EqQ[b*c - a*d, 0] && EqQ[d/b, 2]
&& IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{2} \int \csc (a+b x) \, dx \\ & = -\frac {\text {arctanh}(\cos (a+b x))}{2 b} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(42\) vs. \(2(14)=28\).

Time = 0.02 (sec) , antiderivative size = 42, normalized size of antiderivative = 3.00 \[ \int \cos (a+b x) \csc (2 a+2 b x) \, dx=\frac {1}{2} \left (-\frac {\log \left (\cos \left (\frac {a}{2}+\frac {b x}{2}\right )\right )}{b}+\frac {\log \left (\sin \left (\frac {a}{2}+\frac {b x}{2}\right )\right )}{b}\right ) \]

[In]

Integrate[Cos[a + b*x]*Csc[2*a + 2*b*x],x]

[Out]

(-(Log[Cos[a/2 + (b*x)/2]]/b) + Log[Sin[a/2 + (b*x)/2]]/b)/2

Maple [A] (verified)

Time = 0.34 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.57

method result size
default \(\frac {\ln \left (\csc \left (x b +a \right )-\cot \left (x b +a \right )\right )}{2 b}\) \(22\)
risch \(-\frac {\ln \left ({\mathrm e}^{i \left (x b +a \right )}+1\right )}{2 b}+\frac {\ln \left ({\mathrm e}^{i \left (x b +a \right )}-1\right )}{2 b}\) \(36\)

[In]

int(cos(b*x+a)/sin(2*b*x+2*a),x,method=_RETURNVERBOSE)

[Out]

1/2/b*ln(csc(b*x+a)-cot(b*x+a))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 30 vs. \(2 (12) = 24\).

Time = 0.25 (sec) , antiderivative size = 30, normalized size of antiderivative = 2.14 \[ \int \cos (a+b x) \csc (2 a+2 b x) \, dx=-\frac {\log \left (\frac {1}{2} \, \cos \left (b x + a\right ) + \frac {1}{2}\right ) - \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) + \frac {1}{2}\right )}{4 \, b} \]

[In]

integrate(cos(b*x+a)/sin(2*b*x+2*a),x, algorithm="fricas")

[Out]

-1/4*(log(1/2*cos(b*x + a) + 1/2) - log(-1/2*cos(b*x + a) + 1/2))/b

Sympy [F(-1)]

Timed out. \[ \int \cos (a+b x) \csc (2 a+2 b x) \, dx=\text {Timed out} \]

[In]

integrate(cos(b*x+a)/sin(2*b*x+2*a),x)

[Out]

Timed out

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 84 vs. \(2 (12) = 24\).

Time = 0.19 (sec) , antiderivative size = 84, normalized size of antiderivative = 6.00 \[ \int \cos (a+b x) \csc (2 a+2 b x) \, dx=-\frac {\log \left (\cos \left (b x\right )^{2} + 2 \, \cos \left (b x\right ) \cos \left (a\right ) + \cos \left (a\right )^{2} + \sin \left (b x\right )^{2} - 2 \, \sin \left (b x\right ) \sin \left (a\right ) + \sin \left (a\right )^{2}\right ) - \log \left (\cos \left (b x\right )^{2} - 2 \, \cos \left (b x\right ) \cos \left (a\right ) + \cos \left (a\right )^{2} + \sin \left (b x\right )^{2} + 2 \, \sin \left (b x\right ) \sin \left (a\right ) + \sin \left (a\right )^{2}\right )}{4 \, b} \]

[In]

integrate(cos(b*x+a)/sin(2*b*x+2*a),x, algorithm="maxima")

[Out]

-1/4*(log(cos(b*x)^2 + 2*cos(b*x)*cos(a) + cos(a)^2 + sin(b*x)^2 - 2*sin(b*x)*sin(a) + sin(a)^2) - log(cos(b*x
)^2 - 2*cos(b*x)*cos(a) + cos(a)^2 + sin(b*x)^2 + 2*sin(b*x)*sin(a) + sin(a)^2))/b

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 28 vs. \(2 (12) = 24\).

Time = 0.30 (sec) , antiderivative size = 28, normalized size of antiderivative = 2.00 \[ \int \cos (a+b x) \csc (2 a+2 b x) \, dx=-\frac {\log \left (\cos \left (b x + a\right ) + 1\right ) - \log \left (-\cos \left (b x + a\right ) + 1\right )}{4 \, b} \]

[In]

integrate(cos(b*x+a)/sin(2*b*x+2*a),x, algorithm="giac")

[Out]

-1/4*(log(cos(b*x + a) + 1) - log(-cos(b*x + a) + 1))/b

Mupad [B] (verification not implemented)

Time = 21.00 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.86 \[ \int \cos (a+b x) \csc (2 a+2 b x) \, dx=-\frac {\mathrm {atanh}\left (\cos \left (a+b\,x\right )\right )}{2\,b} \]

[In]

int(cos(a + b*x)/sin(2*a + 2*b*x),x)

[Out]

-atanh(cos(a + b*x))/(2*b)